<template>
	<!-- 搜索商品页 -->
	<view class="Jy_home_serach_page">
		<view class="Jy_home_location_option_group">
			<!-- 商品搜索框 -->
			<view class="loction_serach_group">
				<view class="loction_serach_box">
					<view class="serach_icon_box">
						<image src="http://120.78.177.187:8083/crmebimage/public/mpImage/home/serach_icon.png" mode="aspectFit"></image>
					</view>
					<view class="serach_text_box">
						<input type="search" placeholder="请输入商品名称" confirm-type="search" v-model="serachVal" @confirm="getSerachConfirm()">
					</view>
				</view>
			</view>
			
			<!-- 搜索历史 -->
			<view class="sou_history_group">
				<view class="title_box">
					<text>搜索历史</text>
				</view>
				<view class="history_tags_group">
					<view class="history_tags_list" v-for="(item, index) in 10" :key="index">
						<view class="shop_tags">
							<text>商品名称{{index}}</text>
						</view>
					</view>
				</view>
			</view>
			
			<!-- 推荐搜索 -->
			<view class="sou_history_group">
				<view class="title_box">
					<text>英郎推荐</text>
				</view>
				<view class="history_tags_group">
					<view class="history_tags_list" v-for="(item, index) in 10" :key="index">
						<view class="shop_tags">
							<text>商品名称{{index}}</text>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				serachVal: ''
			};
		},
		methods: {
			// 点击键盘下面搜索按钮触发
			getSerachConfirm() {
				console.log("serach");
				if (this.serachVal) {
					uni.showToast({
						icon:'loading',
						title: '正在搜索商品'
					})
					uni.navigateTo({
						url: '/pagesH/main/customerHome/shoppingList/shoppingList'
					})
				} else {
					uni.showToast({
						icon: 'none',
						title: '搜索内容不能为空~'
					})
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
@import 'customerSerach.scss';
</style>
